function createPeerConnection() {
    try {
        pc = new RTCPeerConnection(pc_config, pc_constraints);
        pc.onicecandidate = handleIceCandidate;
        console.log('Created RTCPeerConnnection with:\n' +
            '  config: \'' + JSON.stringify(pc_config) + '\';\n' +
            '  constraints: \'' + JSON.stringify(pc_constraints) + '\'.');
    } catch (e) {
        console.log('Failed to create PeerConnection, exception: ' + e.message);
        alert('Cannot create RTCPeerConnection object.');
        return;
    }
    pc.onaddstream = handleRemoteStreamAdded;
    pc.onremovestream = handleRemoteStreamRemoved;

    if (isInitiator) {
        try {
            // Reliable Data Channels not yet supported in Chrome
            sendChannel = pc.createDataChannel("sendDataChannel",
                {reliable: false});
            sendChannel.onmessage = handleMessage;
            trace('Created send data channel');
        } catch (e) {
            alert('Failed to create data channel. ' +
                'You need Chrome M25 or later with RtpDataChannel enabled');
            trace('createDataChannel() failed with exception: ' + e.message);
        }
        sendChannel.onopen = handleSendChannelStateChange;
        sendChannel.onclose = handleSendChannelStateChange;
        console.log('....................this is  a initiator = true....................');
    } else {
        pc.ondatachannel = gotReceiveChannel;
        console.log('....................this is not a initiator = false....................');
    }
}